package com.example.demo.clone;

public class Test {

    public static void main(String[] args) throws CloneNotSupportedException {

        Address address = new Address();
        address.setAddress("汉中");

        Person p1 = new Person(100, new String("jim"));
        p1.setAddress(address);

        Person p2 = p1.clone();
        p2.setName(new String("tom"));
        address.setAddress("西安");

        // jim   西安
        System.out.println(p1);
        // tom    汉中
        System.out.println(p2);
    }


    @org.junit.Test
    public void test() {
        String str = "Hello";
        change(str);
        System.out.println("1" + str);
    }


    public void change(String str) {
        str = "YES";
        System.out.println("2" + str);
    }


    @org.junit.Test
    public void test2() {
        System.out.println(waysToStep(61));

    }

    public long waysToStep(int n) {
        if (n == 0) {
            return 0;
        }
        if (n == 1) {
            return 1;
        }
        if (n == 2) {
            return 2;
        }
        if (n == 3) {
            return 4;
        }
        long a = 1, b = 2, c = 4, d = 0;
        for (int i = 4; i <= n; i++) {

            d = a % 1000000007 + b % 1000000007 + c % 1000000007;
            a = b % 1000000007;
            b = c % 1000000007;
            c = d % 1000000007;

        }
        return d;
    }
}